home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
Virtual User 1.0
/
Example Libraries
/
Read me First!!!
next >
Wrap
Text File
|
1991-01-25
|
5KB
|
123 lines
This folder contains useful VU task libraries which you might want to
make use of in your scripts.
The files and brief descriptions of their contents follows:
1. StringsLib.vu
Contains: Task defintions to convert numbers into strings and strings into numbers.
The main tasks are:
a) task NumToStr(number)
This task takes in a number and converts it into a string. If the argument
passed in is not a number undefined is returned.
b) task StrToNum(str, start_index := 1, end_index := -1)
This task takes in a string and converts it into an integer, if possible.
You can pass a start and end indices into a string in which a number is
embedded. This task deals with both positive and negative numbers.
It returns MaxNum (32767) or MinNum (-32767) in error(overflow) conditions.
It deals with cases such as "+123" and "-462" as well as unsigned ones like "981".
If the argument passed in is not a string undefined is returned.
2. UtilityTasksLib.vu -
Contains: Tasks that help do some simple operations like selecting a
file in a window or trashing it.
a) GracefulExit( msg )
Exits VU after printing the supplied 'msg' along with script
execution time.
b) UseKeyboardEquivalent(alias) :
Do Menu command (selection) using key equivalent
c) NumberOfWindows() :
Returns the total number of open windows. In system 7.0's Finder the
Desktop is considered a window. This task ignores that window and
returns the number of regular open windows.
d) RunningSystemSeven() :
Checks if the target running System 7.0. Returns true or false value.
e) task OpenOneWindow() :
This task makes sure that one window is left open in the Finder.
f) task FindObjectInWindow (at_x, at_y)
This task moves the mouse on to a particular object of interest.
Very useful to select files in "View By Name" mode in Finder.
g) LaunchAppInSystem6( appName := "", launch_wait := 2 )
Check for app running and/or attempt to get there by:
double-clicking the topmost file (in View by Name) in the frontmost
window in Finder. ( Intended for use under System 6.0.x )
launch_wait is the number of seconds to wait before checking for
successful launch of the application.
h) LaunchAppInSystem7( appName := "", launch_wait := 4 )
Check for app running and/or attempt to get there by:
Using Finder's Find command to select the App, then using the open
command ( Intended for use under System 7.0 only).
launch_wait is the number of seconds to wait before checking for
successful launch of the application.
i) CheckForAlertWindow(override_alerts := false) :
This task handles alert dialogs with 'OK' and 'Cancel' buttons.
If override_alerts is true then select 'OK' else 'Cancel'
j) task ThrowItemToTrash(print_any_error := true, override_alerts := false)
This task trashes a specified object in Finder. The argument
'print_any_error' can be used to suppress the error messages
printed by this task.
'override_alerts' can be used to trash despite alerts (it selects
the 'OK' button) if this argument is true (or non null).
3. StandardDialogsLib.vu -
Contains: Sample tasks for working with standard Macintosh dialogs
The tasks in this file are:
a) DoSaveAs( save_title := 'Untitled' ) :
This task handles a simple case of saving a file with the Standard
File dialog.
b) SelectFromStandardFile(path_to_file,maximum_nesting_depth := 64) :
This task will select a file from the standard file dialog.
It navigates through the dialog by way of the keyboard.
It takes two parameters, one is a list of file prefixes that will
take the virtual user down to the file you want selected. The list
must contain the strings that VU can type to reach the file. They
may be the complete folder names or enough of the folder name to
distinguish them from sibling folders. The second is a number
indicating the current directory's maximum depth. VU uses this
number to get up to the top using command-up arrow. By default, it
is 64 so it isn't necessary to pass the second parameter. The
operation may be made faster, however, if you pass it a smaller
number. A sample call might look like this:
SelectFromStandardFile( { "HD","MPW","Interf","Cinclu",
"Palettes" },10 );
4. TimeLib.vu -
Contains: Tasks that make it easier to work with time in VU.
a) task WaitForTime( end_hour := 0, end_minute := 0, end_second := 0 ) :
This task will wait until a specified time of day.
b) task PrintCurrentTime(print_date := true) :
This task pretty prints the current time. The format is as follows:
<hour of day>:<minutes>:<seconds> <AM or PM>
It also takes one parameter that indicates whether the date should be
printed.
If the actual parameter passed is a true value, the current date is also
printed .
If no parameter is passed, the date is printed by default.
The format of the date is as follows:
<month>/<day>/<year>
c) task TimeElapsed ( StartTime, StopTime ):
This task computes the difference between the start & stop time
descriptors and returns the result in a time desciptor. The dates are
ignored. For example,
TimeElapsed([time h:2100 s:20], [time h:2220 s:40])
will result in [time h:120 s:20]